﻿@using CaptchaMvc.HtmlHelpers;
@using KL.Store.Core;
@model KL.Store.Web.Models.ChangePasswordModel
@{
    ViewBag.Title = "Şifre Değiştirme";
    ViewBag.hasSub = "true";
    Layout = "~/Views/Shared/" + Parameters.Layout + ".cshtml";
    var columnCssClass = "col-xs-12 col-sm-12 col-md-3 col-lg-2 left first last";
    var contentCssClass = "col-xs-12 col-sm-12 col-md-9 col-lg-10 right";
    if (Parameters.Theme == "DK" || Parameters.Theme == "EO")
    {
        columnCssClass = "col-xs-12 col-sm-12 col-md-4 col-lg-3 left first last";
        contentCssClass = "col-xs-12 col-sm-12 col-md-8 col-lg-9 right";
    }
    else if (Parameters.Theme == "WU")
    {
        columnCssClass = "col-xs-12 col-sm-12 col-md-4 col-lg-3 left";
        contentCssClass = "col-xs-12 col-sm-12 col-md-8 col-lg-9 right";
    }
}
@if (Parameters.Theme != "HA")
{
    <div class="breadcrumb col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="bcBorder"></div>
        <div class="bcLinks">
            <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                <a href="/" itemprop="url">
                    <span itemprop="title">Anasayfa</span>
                </a>›
            </div>
            <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                <a href="/Account/Index" itemprop="url">
                    <span itemprop="title">Hesabım</span>
                </a>›
            </div>
            <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                <a href="/Account/ChangePassword" itemprop="url">
                    <span itemprop="title">Şifre Değiştirme</span>
                </a>
            </div>
        </div>
        <div class="bcBorder"></div>
    </div>
    <div class="clearfix"></div>
}
<div class="@columnCssClass">
    @if (Parameters.ShowCategoryOnAccountPages)
    {
        Html.RenderAction("Categories", "Partials");
    }
    @{ Html.RenderAction("Account", "Partials"); }
    @{ Html.RenderAction("Information", "Partials"); }
</div>
<div class="@contentCssClass">
    <div class="content">
        <h1>Şifre Değiştirme</h1>
        @using (Html.BeginForm(null, null, null, FormMethod.Post, new { name = "password", id = "password", @class = "form-horizontal" }))
        {
            <div class="form-group">
                <label for="OldPassword" class="col-sm-3 control-label">Eski Şifreniz<span class="requireStar">*</span> : </label>
                <div class="col-xs-12 col-sm-12 col-md-9 col-lg-8">
                    @Html.PasswordFor(model => model.OldPassword, new { @class = "form-control", placeholder = "Eski Şifrenizi Yazınız", autocomplete = "off" })
                </div>
                @Html.ValidationMessageFor(model => model.OldPassword)
            </div>
            <div class="form-group">
                <label for="NewPassword" class="col-sm-3 control-label">Yeni Şifreniz<span class="requireStar">*</span> : </label>
                <div class="col-xs-12 col-sm-12 col-md-9 col-lg-8">
                    @Html.PasswordFor(model => model.NewPassword, new { @class = "form-control", placeholder = "Yeni Şifrenizi Yazınız", autocomplete = "off" })
                </div>
                @Html.ValidationMessageFor(model => model.NewPassword)
            </div>
            <div class="form-group">
                <label for="ConfirmPassword" class="col-sm-3 control-label">Yeni Şifreniz (Tekrar)<span class="requireStar">*</span> : </label>
                <div class="col-xs-12 col-sm-12 col-md-9 col-lg-8">
                    @Html.PasswordFor(model => model.ConfirmPassword, new { @class = "form-control", placeholder = "Yeni Şifrenizi Yazınız", autocomplete = "off" })
                </div>
                @Html.ValidationMessageFor(model => model.ConfirmPassword)
            </div>
            <div class="form-group">
                <label for="ConfirmPassword" class="col-sm-3 control-label">Doğrulama Kodu<span class="requireStar">*</span> : </label>
                <div class="col-xs-12 col-sm-12 col-md-9 col-lg-8">
                    @Html.Captcha("Yenile", "Doğrulama kodunu giriniz.", 5, "Bu alan zorunludur.")
                    <div class="captchaBG">
                    </div>
                </div>
            </div>
            if (!ViewData.ModelState.IsValid)
            {
            <div class="bg-danger bs-bgb">
                @Html.ValidationSummary(true, "Şifre değiştirme işlemi başarısız oldu. Lütfen eksik bilgileri kontrol ediniz.")
            </div>
            <br />
            }
            <div class="col-sm-3"></div>
            <div class="col-xs-12 col-sm-12 col-md-9 col-lg-8" style="padding-left: 6px;">
                <a href="/Account/Index" class="btn btn-custom1">Geri</a>
                <a onclick="$('#password').submit();" class="btn btn-custom1">Kaydet</a>
            </div>
        }
    </div>
</div>
@if (Parameters.Theme == "JJ")
{
    <script>
        $(document).ready(function ()
        {
            if ($(window).width() < 980)
            {
                $(".breadcrumb").parent().attr("class", $(".breadcrumb").parent().attr("class") + " first last");
            }
        });
    </script>
}
@if (Parameters.WebSiteTrackingCode != "")
{ 
    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', '@Parameters.WebSiteTrackingCode']);
        _gaq.push(['_setDomainName', '@Parameters.WebSiteTrackingDomainName']);
        _gaq.push(['_setAllowLinker', true]);
        _gaq.push(['_trackPageview']);

        (function ()
        {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
}